// 类 封装、继承、多态
class Animal {
    protected name: string;
    constructor(name) {
        this.name = name
    }
    run(){
        return `${this.name} is runing`
    }
}

// 继承
class Dog extends Animal{
    bark(){
        return `${this.name} is barking`
    }
}

const Bob = new Dog('Bob')
console.log(Bob.run())
console.log(Bob.bark())

class Cat extends Animal{
    static categories = ['mammal']
    constructor(name) {
        super(name)
        console.log(this.name)
    }
    run(){
        return `Meow ${super.run()}`
    }
}

const cat = new Cat('miaomiao')
console.log(cat.run())
